﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Security.Principal;

namespace Wicresoft.UnifyShow.Portal
{
    public class CustomIdentity : IIdentity
    {
        private string authenticationType;
        private bool isAuthenticated;
        private string name;
        private string displayName;
        private DateTime? loginTime;
        private string uid;
        public string dept;

        public CustomIdentity()
        {
            isAuthenticated = false;
        }

        public CustomIdentity(string cn, string uid, string dept, DateTime? loginTime, string authenticateType)
        {
            this.name = cn;
            this.uid = uid;
            this.dept = dept;
            this.loginTime = loginTime;
            this.authenticationType = authenticateType;
            isAuthenticated = true;
        }

        #region IIdentity

        public string AuthenticationType
        {
            get { return authenticationType; }
        }

        public bool IsAuthenticated
        {
            get { return isAuthenticated; }
        }

        /// <summary>
        /// name&displayName
        /// </summary>
        public string Name
        {
            get { return name + "&" + displayName; }
        }

        #endregion
    }
}